home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
096
/
dirnly11.arc
/
DIRONLY.DOC
< prev
next >
Wrap
Text File
|
1986-11-18
|
10KB
|
227 lines
DIRONLY version 1.1 - (c) 1986 by Ken Goosens
11-17-86 10201 Grosvenor, #1614
Rockville, MARYLAND, USA
Ken Goosens can be reached on his bulletin board at 202-537-7475
or 202-537-7945.
A complete set of files for this program includes:
DIRONLY.DOC - this file
DIRONLY.EXE - Executable code
DIRONLY.BAS - source code
UPDATE HISTORY
Update 1.1. 11-17-86. Enhanced to exclude comment lines
from list of files. Was erroneously interpreting lines with
commentary as directory entries.
First released. 11-14-86.
LIMITED LICENSE
The author reserves all rights to any revenue from the use or distribution
of DIRONLY. This means that if the use of DIRONLY helps you make money,
the author expects some form payment for its use. The payment is
negotiable and may be an exchange of goods or services as well as money.
If you want to use DIRONLY in support of a business that generates revenue,
you must obtain a license from the author. The author grants individuals
a free license to use DIRONLY only in support of a free, public service.
This is true not only for DIRONLY, but for any use of the source code.
Corporate use or redistribution requires a site license. Bulletin boards
and non-profit computer organizations can distribute copies, but distribution
with a commercial product requires a license.
Can I freely use DIRONLY if
o I run a commercial bulletin board where I charge an annual fee, say
$25?
Answer: No. But you can make DIRONLY available for downloading.
o I run a commercial board but offer a free public board in addition?
Answer: Yes, the free public service is enough.
o I run a government bulletin board, charging users only enough to
cover costs?
Answer: No, the board is not free and generates revenue. Count
the use of DIRONLY as a part of your expenses.
Can I freely distribute DIRONLY if
o I give it away for free to people who buy my bulletin board
software?
Answer: No, no more than you can give IBM's DOS away. Whatever
enhances the value of your commercial product deserves remuneration.
o I charge people for the cost of a diskette and a small service fee?
Answer: It depends. Not if there are profits from the sale which
go into salaries or commissions. But yes if the sales exclusively
support a non-profit service organization, like a computer user group.
WHAT DOES DIRONLY DO?
DIRONLY is a utility which checks to see whether the files in
lists of files really do exist and if they are in the file directory
only and not present, outputs the names of the missing files.
This is most useful for bulletin board systems that maintain lists
of files that can be downloaded. You can run DIRONLY to validate
your lists.
ASSUMPTIONS THAT DIRONLY MAKES
DIRONLY should work properly with many bulletin board systems,
including RBBS and PC-Board. The only assumptions it makes are
(1) File names are stored as the first word in a line, begin
in column 1, terminate with a space, and have at most
12 characters.
(2) Each line with a file name terminates with a carriage-return
line-feed.
(3) Unless you specify a minimum line size below 26, DIRONLY
assumes that lines with file name entries have at least 29
characters and have a dash (-) in columns 26 and 29 (as a date
divider).
Lines not satisfying these requirements are assumed to be
commentary lines in a directory rather than directory entries.
(4) There are not more than 100 directories to search.
Additional text can occur after the file name as long as there is a
space between the file name and the additional text.
When a file name is not found, its entire line and not just the name is
written out the the file of missing files.
A QUICK START
You run a bulletin board system. You keep lists of downloadable files
in the following files: UPLOADS.DIR, ALPHA.DIR, COMM.DIR. You want
to make sure that all of the files listed in these three files really
are available to callers for downloading. You allow downloading from
the following subdirectories: C:\UP, D:\OLD, E:\OLD. There are 3
steps you need to take to use DIRONLY:
o Create a file called FILEDIRS which has your list of directory
files in it, one to a line. The following 3 lines would be in
it:
UPLOADS.DIR
ALPHA.DIR
COMM.DIR
You can also include and drive/path in front of the file name
if there files are not on the default direcory.
o Create a file called DRVDIRS which has the places to search for
files in it, one to a line. The following 3 lines would be in
it:
C:\UP
D:\OLD
E:\OLD
A tip: performance will be improved if you list the directories
in the most likely order files will be found.
o Invoke DIRONLY. It will ask you to confirm that the minimum
line length for directory entries is 29, the file of
directories in FILEDIRS, the file of drive/paths to search is
DRVDIRS, and you want the missing files listed in MISSING.FIL.
Press RETURN and you will get a status as DIRONLY searches for
any missing files.
What you do with the listing of missing files is up to you. Most people
print it and then either restore the missing file or edit out the entry
from the directory file.
WHAT'S DIFFERENT ABOUT DIRONLY?
There are other utilities that do the same thing. The main difference
in DIRONLY is that
o there is NO EFFECTIVE LIMIT on the size of the directories or
the number of files it will check.
Hence DIRONLY will work properly ON VERY LARGE SYSTEMS of any size.
DIRONLY has no effective limit because it does not read the directories
into memory but simply uses DOS calls to check whether a file exists.
BUT DOESN'T THIS MEAN THAT DIRONLY IS DOG SLOW because of the many disk
accesses when the number of files on disk is large? YES and NO. DIRONLY
is as fast as DOS - which starts to get slow where the number of files in
directories gets to be over 512. Yes - when there are many large
subdirectories to search. A program that reads the directories into
memory, sorts them alphabetically, and does a binary search will outperform
DIRONLY when the number of files gets large - say 1000-3000. BUT
performance is not as bad as you might fear because DIRONLY uses adaptive
search routines to decide where to look and learns from experience!
DIRONLY performs two adaptive adjustments in its searches. First, it keeps
an evolving list of what order to search the drive/paths for every
drive/path. And second, it decides which search list to use based on where
it last found a file. Most directory lists are highly clustered - files
tend to be stored together - and DIRONLY will perform very well when this
occurs.
Searching for 106 files in two file directories across two drive directories
with 39 and 336 files in them, when 3 files were missing, took approximately
27 seconds. Checking 8200 entries on a large networked system look about
2 hours.
HOW TO RUN DIRONLY
DIRONLY works by invoking it with arguments. The format is
DIRONLY [/M=x] <file dirs> <drive/path dirs> <output>
where
/M=x = Minimum size of a valid line (exclude shorter)
<file dirs> = file of directory files (lists of files)
<drive/path dirs> = file of drive/paths to search
<output> = list of files found to be missing
DIRONLY will display a copyright and a page of documentation, and
ask you to <Q>uit or <R>un with the specified setup.
The optional minimum size parameter can be used to control whether
DIRONLY will exclude lines because they lack a date. Many sysops
include text commentary lines inside directory files which should
be excluded rather than interpreted as a directory entry. Normal
directory entires have a date in the form MM-DD-YY beginning in
column 24. DIRONLY will look in columns 26 and 29 for a dash
and exclude the line as a non-directory entry if there is no dash.
If you want DIRONLY not to use the date exclusion test, set the
minimum length below 26 (the date field requires the line to have at
least 29 characters). This might be useful if you have only a
list of only file names you want to check. DIRONLY will still
exclude lines below this minimum length, so if you want no exclusion
at all, set the minimum to be 0.
RECOMPILING
DIRONLY is written in QuickBasic and the source is enclosed in the
hopes that people will correct bugs and add enhancements which they
will share. If you want to share enhancments, please send them to
the author rather than distributing them independently. DIRONLY uses an
assembler routine from the ADVANCED BASIC library distributed by TOM
HANLIN to determine whether a file exists.